package Hot100.Tree;

import javax.swing.plaf.InsetsUIResource;
import java.util.ArrayList;
import java.util.List;

public class inorderTraversal {
    public static void main(String[] args) {
        int[] value = {1,-1,2,3};
        BinaryTree binaryTree = new BinaryTree();
        binaryTree.insert(value);
        System.out.println(inorderTraversal(binaryTree.root));
    }
    public static List<Integer> inorderTraversal(TreeNode root) {
        List<Integer> list = new ArrayList<>();
        inorder(root,list);
        return list;

    }
    public static void inorder(TreeNode root, List<Integer> res){
       if(root == null)
           return;
       inorder(root.left,res);
       res.add(root.val);
       inorder(root.right,res);
    }

}
